package com.heisnenhub.common.module.utils;

import lombok.SneakyThrows;
import org.apache.commons.lang3.time.DateUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @author sen
 * @description
 * @date 2024/1/9 14:43
 */

public class TimeUtils {
    public final static String  YMDHMS = "yyyyMMddHHmmss";
    public final static String  YMD_HMS = "yyyy-MM-dd HH:mm:ss";

    public final static String  YMD_HM = "yyyy-MM-dd HH:mm";

    public final static String  YMD = "yyyy-MM-dd";


    public static SimpleDateFormat format_ymd_hms=new SimpleDateFormat(YMD_HMS);


    /**
     * 现在的时间
     * @return
     */
    public static Date nowDate(){

        return new Date();
    }

    /**
     *  得到当前时间  yyyy-MM-dd hh:mm:ss
     * @return
     */
    public static String nowDateStr(){
        return format_ymd_hms.format(nowDate()).toString().trim();
    }

}
